import request from "@/utils/request";
export const service = () => {
  return !!JSON.parse(localStorage.$loginInfo).tenantId ? "/event" : "/ttevent";
};
export const device = () => {
  return !!JSON.parse(localStorage.$loginInfo).tenantId
    ? "/device"
    : "/ttdevice";
};
// 铁塔账号 关键字查询租户
export function queryTenantInfo(query) {
  return request({
    // url: "/system/tenant/queryTenantInfo",
    url: "/admin/custom/manage/queryTenantInfo",
    method: "post",
    data: query,
  });
}

export function getDeviceList(query) {
  return request({
    url: device() + "/video/device/getDeviceList",
    method: "post",
    data: query,
  });
}

export function getRegion(query) {
  return request({
    url: "/admin/video/getRegion",
    method: "post",
    data: query,
  });
}

export function getEnumInfo(query) {
  return request({
    url: "/admin/base/system/dict/data/dictType/" + query.enumTypeId,
    method: "get",
  });
}

export function findOrderAlarm(query) {
  return request({
    url: service() + "/alarm/type/findOrderAlarm",
    method: "post",
    data: query,
  });
}

export function getLeaderAuditList(query) {
  return request({
    url: service() + "/alarm/order/getLeaderAuditList",
    method: "post",
    data: query,
  });
}

export function getVideoPlaybackUrl(query) {
  return request({
    url: "/video/getVideoPlaybackUrl",
    method: "post",
    data: query,
  });
}

//
export function getOrderAuthority(query) {
  return request({
    url: "/admin/system/business/getDataScopeObj",
    method: "post",
    data: query,
  });
}

export function updateLeaderAudit(query) {
  return request({
    url: service() + "/alarm/order/updateLeaderAudit",
    method: "post",
    data: query,
  });
}

export function oauthToken(query) {
  return request({
    url: service() + "/alarm/receive/oauthToken",
    method: "post",
    data: query,
  });
}

export function getLoginUserEnforcementInfo() {
  return request({
    url: service() + "/alarm/receive/getLoginUserEnforcementInfo",
    method: "get",
  });
}

export function getOrderInfo(query) {
  return request({
    url: service() + "/alarm/order/getOrderInfo",
    method: "post",
    data: query,
  });
}

export function getLeaderAufitInfo(query) {
  return request({
    url: service() + "/alarm/order/getLeaderAufitInfo",
    method: "post",
    data: query,
  });
}
